package com.situ.service;

import java.io.Serializable;
import java.util.ArrayList;

import com.situ.domain.Major;
import com.situ.domain.Student;

public class StudentListService implements Serializable{
	/** serialVersionUID*/  
    private static final long serialVersionUID = 6213131L;
    
    private ArrayList<Student> stuList =  new ArrayList<Student>();
	
	// 获取所有学生信息
	public ArrayList<Student> listStudents() {
		return stuList;
	}
	
	// 添加新生
	public boolean insertStu(Student student) {
		return stuList.add(student);
	}

	// 初始化
	public StudentListService() {
		Student student1 = new Student(10, "张三", 21, 1);
		Major tomMaor = new Major(1023, "计算机科学与技术");
		Student student2 = new Student(11, "Tom", 2, 1, tomMaor);
		stuList.add(student1);
		stuList.add(student2);
	}

	
}
